package com.jzlx.threads;

/**
 * @description: 守护线程
 * @author: zhulei
 * @create: 2025-03-25 10:10
 **/
public class DaemonAwaitThread extends Thread {
    private boolean stopAwait = true;

    public boolean isStopAwait() {
        return stopAwait;
    }

    public void setStopAwait(boolean stopAwait) {
        this.stopAwait = stopAwait;
    }

    @Override
    public void run() {
        while (stopAwait){
            System.out.println("client is alive");
            try {
                Thread.sleep(50000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
